<template>
    <div class="divisionG">
        <div class="choice">
            <scroller class="scroller choiceItem">
                <list class="listCont">
                    <cell class="listContItem" v-for="(item, index) in datalist" :key="index" @click="polling(index, item)" :class="[index === activeIndex ? 'active' : '']" >
                        <input type="radio" name="aa" class="input" :class="[onInd === index ? 'activeInput' : '']" /><text class="text" ref="item" :class="[index === activeIndex ? 'active' : '']">{{item}}</text>
                    </cell>
                </list>
            </scroller>
        </div>
    </div>
</template>
<script>
const eventBus = weex.requireModule('bmEvents')
const dom = weex.requireModule('dom')

export default {
    name: 'time',
    data(){
        return {
            datalist: ['全部', '2018-第一季度', '2018-第二季度', '2018-第三季度', '2018-第四季度', '2019-第一季度', '2019-第二季度'],
            onInd: 0,
            activeIndex: 0,
            placeNameAll: [],
            XZQHDM: []
        }
    },
    beforeCreate() {
        // this.$notice.loading.show()
    },
    created(){
        // this.getdata()
    },
    methods: {
        getdata () {
          event.XZQH(this.adcd).then(res => { 
              this.datalist = res.result.datalist
              this.$nextTick(() => {
                this.scrollEnd()
                this.$notice.loading.hide()
              })
          })
        },
        polling(index, item){
            eventBus.emit('timeEvent', item)
            this.activeIndex = index;
            this.onInd = index;
            this.$emit('closeList')
        }
    }
}
</script>
<style scoepd>
.divisionG {
    width: 750px;
    position: absolute;
    top: 96px;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
}
.listContItem{
    width: 750px;
    height: 100px;
    border-bottom-color: #ccc;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding-left: 15px;
    background-color: white;
}
.text{
    font-size: 29.1px;
    font-family:PingFangSC-Regular;
    color:rgba(102,102,102,1);
}
.choice{
    margin-top: 260px;
    margin-left: 100px;
    width: 550px;
    height: 600px;
    background-color: white;
}
.active{
    color: rgba(35,196,160,1);
}
.input{
    width: 25px;
    height: 25px;
    border-radius: 25%;
    border-color: rgba(151,151,151,1);
    border-style: solid;
    border-width: 1px;
    margin-right: 20px;
}
.activeInput{
    width: 25px;
    height: 25px;
    border-radius: 25%;
    border-color: rgba(35,196,160,1);
    border-width: 7px;
    border-style: solid;
}
</style>
